<%def name="add()">
 ${self.fileUpload()}
 ${self.generalInfo()}
 ${self.recordingInfo()}
</%def>

<%def name="update()">
 ${self.unalterableData()}
 ${self.generalInfo()}
 ${self.recordingInfo()}
</%def>

<%def name="unalterableData()">
<%namespace file="/base/fileViews.html" name="fileViews" import="displayFile"/>
<br />${c.file.name}
% if app_globals.allowedFileTypes[c.file.MIMEtype]:
    <% fileType = app_globals.allowedFileTypes[c.file.MIMEtype] %>
% else: 
    <% fileType = c.file.MIMEtype.split('/')[0] %>
% endif
${displayFile(c.file, fileType)}
</%def>

<%def name="fileUpload()">
<fieldset>
<legend>File</legend>
<ol>
 <li>
  <label for="fileData">Upload * <span class="emphasize">(text, image, audio or video)</span></label><br />
  ${h.file('fileData', tabindex=1)}
 </li>
</ol>
</fieldset>
</%def>

<%def name="generalInfo()">
<fieldset>
<legend>General Info</legend>
<ol>
 <li>
  <label for="description">Description</label>
  <textarea id="description" name="description" rows="2" cols="10" tabindex="2"></textarea>
 </li>
</ol>
</fieldset>
</%def>

<%def name="recordingInfo()">
<fieldset>
<legend>Recording-specific Info</legend>
<ol>
 <li>
  <label for="speaker">Speaker</label>
  <% speakers = [('', '')] + app_globals.speakers %>
  ${h.select(name='speaker', selected_values="", options=speakers, tabindex=3)}
 </li>
 <li>
  <label for="elicitor">Elicitor</label>
  <% users = [('', '')] + app_globals.users %>
  ${h.select(name='elicitor', selected_values="", options=users, tabindex=4)}
 </li>
 <li>
  <label for="dateElicited">Date Elicited (MM/DD/YYYY)</label>
  <input id="dateElicited" maxlength="10" name="dateElicited" tabindex="5" type="text" />
 </li>
 <li>
  <label for="utteranceType">Utterance Type</label>
  ${h.select(name='utteranceType', selected_values="None", options=[('', 'None'), 'Object Language Utterance', 'Metalanguage Utterance', 'Mixed Utterance'], tabindex=5)}
 </li>
</ol>
</fieldset>
</%def>
